home *** CD-ROM | disk | FTP | other *** search
- Path: pegasus.montclair.edu!harmon
- From: harmon@pegasus.montclair.edu (Derek Harmon)
- Newsgroups: comp.lang.c
- Subject: Re: Array pointing to Dynamic list thingie
- Date: 18 Feb 1996 17:30:01 -0500
- Organization: Montclair State University
- Message-ID: <harmon.824682149@pegasus.montclair.edu>
- References: <4g2qag$pmb@wariat.wariat.org>
- NNTP-Posting-Host: pegasus.montclair.edu
- X-Newsreader: NN version 6.5.0 #68 (NOV)
-
- balif@nacs.net (balif) writes:
-
- >for (i=1;i<10;++i)
- > printf("Skill: %d/n",trainer_mob[3][i]);
- >would print out a list of skills that trainer mob 3 has. But I do not know
- >how long that list will be. I want something where I can say like
-
- Try using 0 (or an arbitrary int which is not a valid skill) to terminate
- the list of skills that can be trained. Then use a while loop as follows,
-
- : i=0;
- : trn=3;
- : while (trainer_mob[trn][i] != 0) {
- : printf("Skill: %d\n", trainer_mob[trn][i]);
- : i++;
- : }
-
- -- Stone
- --
- # Derek Harmon (aka Stonelight) harmon@pegasus.montclair.edu
- # - Computer Science Undergrad, Montclair State University, NJ
- # - My views are my own, nobody else is this creative. 3;)>
- ... Without C we would be programming in BASI, PASAL, and OBOL.
-
-